package EnterpriseAlgorithm.Stack_Queue.Code.CatsAndDog_Queue;


public class Example {
    public static void main(String[] args) {
        DogCatQueue queue = new DogCatQueue();
        queue.add(new Dog("狗1"));
        queue.add(new Cat("猫1"));
        queue.add(new Dog("狗2"));
        queue.add(new Cat("猫2"));
        queue.add(new Dog("狗3"));
        queue.add(new Dog("狗4"));

        System.out.println(queue.pollCat().toString());  //出里栈顶最近的猫
        System.out.println(queue.pollDog().toString());  //出里栈顶最近的狗
        System.out.println(queue.pollAll().toString());  // 顺序出栈
    }
}
